// import request from '@/utils/request'
import request from "./axios-config";
export default {
	//查询acount列表
	findAll(fromData) {
		return new Promise((resolve, reject) => {
			return request({
					url: "/reasonDetailRest/findAll",
					method: "post",
					data: fromData
				})
				.then(response => {
					resolve(response);
				})
				.catch(error => {
					reject(error);
				});
		});
	},
	//添加
	add(fromData) {
		return new Promise((resolve, reject) => {
			return request({
					url: "/reasonDetailRest/add",
					method: "post",
					data: fromData
				})
				.then(response => {
					resolve(response);
				})
				.catch(error => {
					reject(error);
				});
		});
	},
	//停用
	stop(fromData) {
		return new Promise((resolve, reject) => {
			return request({
					url: "/reasonDetailRest/stop?aid=" + fromData,
					method: "get"
				})
				.then(response => {
					resolve(response);
				})
				.catch(error => {
					reject(error);
				});
		});
	},
	//编辑
	edit(fromData) {
		return new Promise((resolve, reject) => {
			return request({
					url: "/reasonDetailRest/update",
					method: "post",
					data: fromData
				})
				.then(response => {
					resolve(response);
				})
				.catch(error => {
					reject(error);
				});
		});
	},
	//删除
	del(fromData) {
		return new Promise((resolve, reject) => {
			return request({
					url: "/reasonDetailRest/delete?tid=" + fromData,
					method: "get"
				})
				.then(response => {
					resolve(response);
				})
				.catch(error => {
					reject(error);
				});
		});
	},
	//余额
	findBalance(fromData) {
		return new Promise((resolve, reject) => {
			return request({
					url: "/balance/find?aid=" + fromData,
					method: "get"
				})
				.then(response => {
					resolve(response);
				})
				.catch(error => {
					reject(error);
				});
		});
	},
	download(fromData) {
		return new Promise((resolve, reject) => {
			return request({
					method: "get",
					url: "/reasonDetailRest/export",
					responseType: 'blob',
					headers: {
						'Content-Type': 'application/json;charset=UTF-8' //后端ssm框架接收json类型
					},
					data: fromData
				})
				.then(response => {
					resolve(response);
				})
				.catch(error => {
					reject(error);
				});
		});
	}
}
